<template>
  <div>
    <div class="box">
      <div class="topBar">
        <el-form
          ref="queryForm"
          :model="queryForm"
          :inline="true"
          label-width="100px"
        >
          <el-form-item label="业务分类" prop="name1">
            <el-input v-model="queryForm.name1" placeholder="请输入">
            </el-input>
          </el-form-item>
          <el-form-item label="业务品种" prop="name2">
            <el-input v-model="queryForm.name2" placeholder="请输入">
            </el-input>
          </el-form-item>
          <el-form-item label="日期" prop="date">
            <el-date-picker
              v-model="queryForm.date"
              type="year"
              value-format="yyyy"
            />
          </el-form-item>
        </el-form>
        <div style="text-align: right">
          <el-button type="primary" class="gray-btn">查询</el-button>
          <el-button type="primary" class="btn">重置</el-button>
        </div>
      </div>
      <div class="bondCardTitle">利率债分销-交易量</div>
      <div class="chart">
        <MultiBar :id="'multiBar'" :chart-data="chartData"></MultiBar>
      </div>
      <div class="bottomInfo">
        <div class="bondCardTitle">表格数据</div>
        <el-table :data="tableData" style="width: 100%">
          <el-table-column type="index" label="序号" align="center">
          </el-table-column>
          <el-table-column prop="type" label="业务分类" align="center">
          </el-table-column>
          <el-table-column prop="name" label="业务品种" align="center">
          </el-table-column>
          <el-table-column prop="month1" label="一月" align="center">
          </el-table-column>
          <el-table-column prop="month2" label="二月" align="center">
          </el-table-column>
          <el-table-column prop="month3" label="三月" align="center">
          </el-table-column>
          <el-table-column prop="month4" label="四月" align="center">
          </el-table-column>
          <el-table-column prop="month5" label="五月" align="center">
          </el-table-column>
          <el-table-column prop="month6" label="六月" align="center">
          </el-table-column>
          <el-table-column prop="month7" label="七月" align="center">
          </el-table-column>
          <el-table-column prop="month8" label="八月" align="center">
          </el-table-column>
          <el-table-column prop="month9" label="九月" align="center">
          </el-table-column>
          <el-table-column prop="month10" label="十月" align="center">
          </el-table-column>
          <el-table-column prop="month11" label="十一月" align="center">
          </el-table-column>
          <el-table-column prop="month12" label="十二月" align="center">
          </el-table-column>
        </el-table>
        <el-pagination
          small
          background
          layout="prev, pager, next"
          :total="total"
          @current-change="pageFn"
        >
        </el-pagination>
      </div>
    </div>
  </div>
</template>
<script>
import MultiBar from "./components/MultiBar.vue";

export default {
  components: { MultiBar },
  data() {
    return {
      queryForm: {
        name1: "",
        name2: "",
        date: "2022",
      },
      selectList: [],
      tableData: [
        {
          type: "中间业务",
          name: "利率债分销",
          month1: "8.3",
          month2: "2.3",
          month3: "-",
          month4: "-",
          month5: "-",
          month6: "-",
          month7: "-",
          month8: "-",
          month9: "-",
          month10: "-",
          month11: "-",
          month12: "-",
        },
      ],
      total: 0,
      chartData: {
        xAxisData: [
          "202201",
          "202202",
          "202203",
          "202204",
          "202205",
          "202206",
          "202207",
          "202208",
          "202209",
          "202210",
          "202211",
          "202212",
        ],
        data: [
          {
            name: "交易量",
            data: [8.3, 2.3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
          },
          {
            name: "发行量",
            data: [17484.8, 9208.3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
          },
        ],
      },
    };
  },
  mounted() {},
  methods: {
    changeRanking() {},
    // async searchBtn(page) {
    //   if (!this.queryForm.data) {
    //     this.queryForm.data = ["", ""];
    //   }
    //   const param = {
    //     ...this.queryForm,
    //     pn: 10,
    //     page: page,
    //     beginDate: this.queryForm.data[0],
    //     endDate: this.queryForm.data[1],
    //   };
    //   delete param.data;
    //   console.log(param, "param");
    //   let res = await bondRiskDetail(param);
    //   this.tableData = res.data.result;
    //   this.total = Number(res.data.totalResults);
    //   console.log(res, "123");
    // },
    resetFn() {
      this.queryForm = {
        // xxx
      };
    },
    pageFn(currentPage) {
      // this.searchBtn(currentPage);
    },
  },
};
</script>
<style lang="scss" scoped>
.box {
  display: flex;
  flex-direction: column;
  height: 100%;

  .chart {
    width: 100%;
    height: 300px;
    margin-bottom: 10px;
    background-color: #262d47;
  }

  .topBar {
    background-color: #262d47;
    margin-bottom: 10px;
    padding: 20px 20px;
    padding-bottom: 10px;
  }

  .bottomInfo {
    flex: 1;
    width: 100%;
    background-color: #262d47;
    padding-bottom: 20px;
  }

  .el-pagination {
    text-align: right;
    margin-top: 10px;
  }

  .el-table {
    min-height: 300px;
  }

  .el-table ::v-deep th.el-table__cell {
    background-color: #1c2238 !important;
    color: #fff;
  }

  .tableBox {
    background-color: #262d47;
    flex: 1;
    padding: 15px 10px;
  }

  .bondCardTitle {
    height: 40px;
    background: #354060;
    font-size: 14px;
    font-family: PingFang-SC-Bold, PingFang-SC;
    font-weight: bold;
    color: #ffffff;
    padding: 10px 16px;
  }
}
</style>
